<html>
<head>
<title>多行输入框设定</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<import type="css" file="css.workform" />
<script>
function my_submit()
{
if(ITEM_NAME.value=="")
{
	 alert("控件名称不能为空");
	 return;
}
if(edit_flag==0)
{
	 var parent_window = parent.dialogArguments;
	 //control_html="<textarea rows=5 cols=50 title=\""+ITEM_NAME.value+"\""+"style=font-size:"+"\""+ITEM_SIZE.value+"\""+" name=\"data_\" >"+ITEM_VALUE.value+"</textarea>";
	 //control_html="<textarea rows=5 cols=50 title=\\""+ITEM_NAME.value.replace("\\"","&quot;")+"\\" style=\\"font-size:"+ITEM_SIZE.value+"\\">"+ITEM_VALUE.value+"</textarea>";
	 control_html="<textarea rows=5 cols=50 title=\""+ITEM_NAME.value+"\""+" name=\"data_\" ></textarea>";
	 parent_window.EDIT_HTML.insertHtml(control_html);
}
else
{
	 oSelection = dialogArguments.document.selection.createRange();
	 sRangeType = dialogArguments.document.selection.type;
	 if (sRangeType == "Control")
	 {
 	oSelection(0).title = ITEM_NAME.value;
 	oSelection(0).value = ITEM_VALUE.value;
 	oSelection(0).style.fontSize = ITEM_SIZE.value;
		}
}
window.close();
}
//-- 获取控件属性 --
var edit_flag=0;
function LoadDo()
{
oSelection = dialogArguments.document.selection.createRange();
sRangeType = dialogArguments.document.selection.type;
if (sRangeType == "Control")
{
	edit_flag=1;
	ITEM_NAME.value = oSelection(0).title;
	ITEM_VALUE.value = oSelection(0).value;
	ITEM_SIZE.value = oSelection(0).style.fontSize.replace("px","");
}
ITEM_NAME.focus();
}
</script>
</head>
<body topmargin="0" onload="LoadDo();">
<table border="0" cellspacing="1" width="100%" class="small" bgcolor="#000000" cellpadding="3" align="center">
<tr class="TableContent">
		<td nowrap>控件名称：
		</td>
		<td nowrap>
		 <Input name="ITEM_NAME" type="text" class="SmallInput" size="20">
		</td>
</tr>
<!--
<tr class="TableContent">
		<td nowrap>默认值：
		</td>
		<td nowrap>
		 <Input name="ITEM_VALUE" type="text" class="SmallInput" size="20">
		</td>
</tr>
<tr class="TableContent">
		<td nowrap>字体大小：
		</td>
		<td nowrap>
		 <Input name="ITEM_SIZE" type="text" class="SmallInput" size="20" title="可选，默认13像素">
		</td>
</tr>
-->
<tr>
		<td class="TableControl" colspan="2" align="center">
			<input type="submit" onclick="my_submit();" value="确 定" class="SmallButton">
		</td>
</tr>
</table>
</body>
</html>